from django.db import models
from lapi_app.models.user_model.user_info import Userinfo


class Performance(models.Model):
    per_name = models.CharField("性能测试任务名称", max_length=255, null=False)
    per_case = models.IntegerField("性能测试用例", null=False)
    per_host = models.CharField("任务启动ip", null=True, max_length=255)
    per_port = models.CharField("任务接口", null=True, max_length=255)
    per_description = models.CharField("任务描述", null=True, max_length=255)
    per_runtime = models.CharField("任务执行时间", null=True, max_length=255)
    create_time = models.DateTimeField("创建时间", auto_now_add=True)
    update_time = models.DateTimeField("更新时间", auto_now_add=True)
    user = models.ForeignKey(Userinfo, on_delete=models.CASCADE)

    def __str__(self):
        return self.per_name
